{if $list}
	<h4 id="choFloatTitle" class="res_cho_fl_title clearfix res_cho_fl_open" rel="choFloatBody">
    	<span class="f_l">菜单 &gt; {$store_info.name}</span>
        <a href="javascript:" class="res_cho_min_a f_r" title="最小化"></a>
        <a href="javascript:" class="res_cho_max_a f_r" title="还原"></a>
    </h4>
    <div id="choFloatBody" class="res_cho_fl_body abs_out" style="position: static; ">
		{if $is_morder eq 0}
    	<ul class="res_cho_fl_opt">
        	<li class="res_cho_fl_do brd">
        		<span class="icons i008 mr5"></span>
				<a href="javascript:void(0);" id="choFoodFavMenu" class="g6">收藏菜单</a>
			</li>
        	<li class="res_cho_fl_do brd">
        		<span class="icons i009 mr5"></span>
				<a href="{url x="store" r="pmenu" p="sid=$sid"}" id="choFoodPrintMenu" class="g6" target="_blank">打印菜单</a>
			</li>
        	<li class="res_cho_fl_do">
        		<span class="icons i010 mr5"></span>
				<a href="{url x="store" r="smenu" p="sid=$sid"}" id="choFoodSmsMenu" class="g6" target="_blank">发送菜单到手机</a>
			</li>
        </ul>
		{/if}
        <div id="choFloatMain" class="res_cho_fl_main clearfix">
        	{if $normal_num gt 0}
        	<div class="clearfix" >
        		<div class="res_cho_fl_key f_l">
					<div class="pl10 clearfix">
						<span>普通菜</span>
						<span>× {$normal_num}</span>
					</div>
				</div>
				<div class="f_l cell bld">
					{foreach from=$list.normal key=key item="item"}
					<ul class="res_cho_fl_list clearfix" {if $key neq 0}style="border-bottom:0;margin-bottom:0;"{/if}>
						<li class="f_l w100" title="{$item.name}">{$item.name}</li>
						<li class="f_l pct25 tc">{function name="format_price" v=$item.price}</li>
						<li class="f_l">
							<input class="res_cho_input" price="{$item.price}" name="resChoInput" value="{$item.nums}" title="修改选菜数量" data-id="{$item.id}">
						</li>
						<li class="f_r">
							<a href="javascript:" class="aclose" name="resChoOpt" title="删除该选菜" data-id="{$item.id}">×</a>
						</li>
					</ul>
					{/foreach}
				</div>
			</div>
			{/if}
        	{if $special_num gt 0}
        	<div class="clearfix">
        		<div class="res_cho_fl_key f_l" {if $normal_num gt 0}style="border-top:1px solid #DDD"{/if}">
					<div class="pl10 clearfix">
						<span>特色菜</span>
						<span>× {$special_num}</span>
					</div>
				</div>
				<div class="f_l cell bld">
					{foreach from=$list.special key=key item="item"}
					<ul class="res_cho_fl_list clearfix" {if $key neq 0}style="border-bottom:0;margin-bottom:0;"{/if}>
						<li class="f_l w100" title="{$item.name}">{$item.name}</li>
						<li class="f_l pct25 tc">{function name="format_price" v=$item.price}</li>
						<li class="f_l">
							<input class="res_cho_input" price="{$item.price}" name="resChoInput" value="{$item.nums}" title="修改选菜数量" data-id="{$item.id}">
						</li>
						<li class="f_r">
							<a href="javascript:void(0);" class="aclose" name="resChoOpt" title="删除该选菜" data-id="{$item.id}">×</a>
						</li>
					</ul>
					{/foreach}
				</div>
			</div>
			{/if}
		</div>
        <div id="choFloatBot" class="res_cho_fl_bot clearfix">
        	<div class="clearfix">
        	{if $takeaway eq 1 && $is_morder eq 1}
        	<p class="g9 mb5">因价格波动导致网上价与实价偏差时，以送达时价格为准</p>
			{else}
        	<p class="g9 mb5">餐厅菜单仅供参考，实际以餐厅公布的价格为准。</p>
			{/if}
			<h6>金额统计<span class="ml10">{function name="format_price" v=$all_price}</span></h6>
			<p class="mt5">统计：{$normal_num}道普通菜，{$special_num}道特色菜</p>
			</div>
			<div class="blank5"></div>
			<div class="clearfix">
				{if $takeaway eq 1 && $is_morder eq 1}
				<div class="grebtn f_l">
					<i class="green_line"></i>
					<strong class="grebtn_in">
						<a href="javascript:void(0);" id="ViewMenuOrderInfo" style="width:114px;padding:.25em 0;" class="grebtn_bg">好了，就这些！</a>
					</strong>
					<i class="green_line"></i>
				</div>
				{/if}
			</div>
		</div>
    </div>
<script type="text/javascript">
	jQuery(function(){
		if($("#choFloatMain .res_cho_fl_key").length > 0){
			$("#choFloatMain .res_cho_fl_key").each(function(){
				$(this).css({"padding-top":($(this).parent().height() - $(this).height())/2})
			});
		}
		$(".res_cho_min_a").click(function(){
			$("#choFloatBody").hide();
			$(".res_cho_max_a").show();
			$(this).hide();
			if($.browser.msie && $.browser.version =="6.0")
			{
				var s_top = $(document).scrollTop()+$(window).height()-$("#choFloatBox").height();
				$("#choFloatBox").css("top",s_top);
			}
		});
		$(".res_cho_max_a").click(function(){
			$("#choFloatBody").show();
			$(".res_cho_min_a").show();
			$(this).hide();
			if($.browser.msie && $.browser.version =="6.0")
			{
				var s_top = $(document).scrollTop()+$(window).height()-$("#choFloatBox").height();
				$("#choFloatBox").css("top",s_top);
			}
		});
		
		$("#choFloatBody .res_cho_input").blur(function(){
			if(!$.checkNumber($(this).val())){
				alert("请输入数字");
				return false;
			}
			var num = $(this).val();
			var id = $(this).attr("data-id");
			set_ctmenu_nums(id,num,function(result){
				$(".res_cho_list").each(function(){
					var obj = $(this);
					if(obj.attr("data-id") == id){
						if(num >0){
							if(!obj.hasClass("res_cho_list_on"))
								obj.addClass("res_cho_list_on");
						}
						else{
							obj.removeClass("res_cho_list_on");
						}
						obj.find(".opt").html(result.html);
					}
				});
				
				get_ctmenu_float_all(true);
			});
		});
		
		$("#choFloatBody .aclose").click(function(){
			var num = 0;
			var id = $(this).attr("data-id");
			set_ctmenu_nums(id,num,function(result){
				$(".res_cho_list").each(function(){
					var obj = $(this);
					if(obj.attr("data-id") == id){
						if(num >0){
							if(!obj.hasClass("res_cho_list_on"))
								obj.addClass("res_cho_list_on");
						}
						else{
							obj.removeClass("res_cho_list_on");
						}
						obj.find(".opt").html(result.html);
					}
				});
				get_ctmenu_float_all(true);
			});
		});
		$("#choFoodFavMenu").bind("click",function(){
			$.ajax({
				url:APP_ROOT + "/store.php?ctl=view&act=favmenu&sid="+store_id,
				cache:false,
				dataType:"json",
				success:function(result){
					if(result.status==2){
						ajax_login();
					}
					else if(result.status==1){
						load_ctmenu_nums_list();
						get_ctmenu_float_all(true);
						$.showSuccess("收藏成功！您可以去<a href='"+APP_ROOT+"/index.php?ctl=uc_collect&act=menu' class='bc'>会员中心</a>进行查看。");
					}
					else{
						alert(result.message);
					}
					return false;
				}
			});
		});
		{if $takeaway eq 1 && $is_morder eq 1}
		$("#ViewMenuOrderInfo").bind("click",function(){
			var all_nums = 0;
			var all_price = 0;
			$("#choFloatBody .res_cho_input").each(function(){
				all_nums +=parseInt($(this).val());
				all_price +=parseFloat($(this).attr("price"));
			});
			if(all_price < all_price){
				$.showErr("起送价格不够哦！");
				return false;
			}
			if(tkaway_nums>0){
				if(all_nums < tkaway_nums){
					$.showErr("起送份数不够哦！");
					return false;
				}
			}
			var html ='<div id="FW-Menu-Order_Info" class="p10">';
				html +='	<div class="tips"><span class="icons imtip"></span>&nbsp;请输入您的送餐地址和联系方式，方便外送员与您联系!</div>';
				html +='	<div class="blank"></div><div class="line"></div>';
				html +='	<div class="blank"></div>';
				html +='	<div class="blank"></div>';
				html +='	<div class="item clearfix">';
				html +='		<b>您的称呼</b>&nbsp;<input class="f-input" style="width: 186px;" id="RealName" name="RealName" value="" type="text" maxlength="4">';
				html +='		<input id="rad0" type="radio" value="1" name="Sex" checked="checked">';
				html +='		<label for="rad0">先生</label>';
				html +='		<input id="rad1" type="radio" value="0" name="Sex">';
				html +='		<label for="rad1">女士</label>';
				html +='	</div>';
				html +='	<div class="blank"></div>';
				html +='	<div class="item clearfix">';
				html +='		<b>联系电话&nbsp;</b><input class="f-input" name="Phone" id="Phone" size="20" maxlength="11" style="width: 186px;" value="" type="text">';
				html +='	</div>';
				html +='	<div class="blank"></div>';
				html +='	<div class="item clearfix">';
				html +='		<b>送餐地址&nbsp;</b><input class="f-input" name="Address" id="Address" size="20" maxlength="50" style="width: 280px;" value="" type="text">&nbsp;<span style="color:#f30;font-weight:bold;">特别重要！</span>';
				html +='	</div>';
				html +='	<div class="blank"></div>';
				html +='	<div class="item clearfix">';
				html +='		<b>备注信息&nbsp;</b><input class="f-input" name="Comment" id="Comment" size="65" maxlength="100" style="width: 280px;" value="" type="text" placeholder="特殊口味、加米饭、带找零等，可在此注明..">&nbsp;(可不填)';
				html +='	</div>';
				html +='	<div class="blank"></div>';
				html +='	<div class="blank"></div>';
				html +='	<div class="clearfix act">';
				html +='		<div class="grebtn f_l">';
				html +='		<i class="green_line"></i>';
				html +='		<strong class="grebtn_in">';
				html +='		<a href="javascript:void(0);" id="MenuOrderSubmit" style="width:114px;padding:.25em 0;" class="grebtn_bg">填好了，提交！</a>';
				html +='		</strong>';
				html +='		<i class="green_line"></i>';
				html +='		</div>';
				html +='	</div>';
				html +='</div>';
			$.weeboxs.open(html,{contentType:'text',showButton:true, showCancel:false, showOk:false,title:'',width:540,type:'wee',onopen:function(){
				$("#MenuOrderSubmit").bind("click",function(){
					if($.trim($("#FW-Menu-Order_Info #RealName").val())==""){
						alert("请输入您的称呼！");
						$("#FW-Menu-Order_Info #RealName").focus();
						return false;
					}
					if($.trim($("#FW-Menu-Order_Info #Phone").val())==""){
						alert("请输入您的电话！");
						$("#FW-Menu-Order_Info #Phone").focus();
						return false;
					}
					else{
						if(!$.checkMobilePhone($.trim($("#FW-Menu-Order_Info #Phone").val()))){
							alert("电话号码有误！");
							$("#FW-Menu-Order_Info #Phone").focus();
							return false;
						}
					}
					
					if($.trim($("#FW-Menu-Order_Info #Address").val())==""){
						alert("请输入您的送餐地址！");
						$("#FW-Menu-Order_Info #Address").focus();
						return false;
					}
					if(confirm("确定提交吗？提交后不可更改哦！")){
						submitOrderMenu();
					}
				});
			}});
		});
		{/if}
	});
	{if $takeaway eq 1 && $is_morder eq 1}
	function submitOrderMenu(){
		var query = new Object();
		query.sid = store_id;
		query.contacter = $.trim($("#FW-Menu-Order_Info #RealName").val());
		query.sex = $.trim($("#FW-Menu-Order_Info input[name='Sex']:checked").val());
		query.tel = $.trim($("#FW-Menu-Order_Info #Phone").val());
		query.address = $.trim($("#FW-Menu-Order_Info #Address").val());
		query.msg = $.trim($("#FW-Menu-Order_Info #Comment").val());
		
		$.ajax({
			url:APP_ROOT + "/store.php?ctl=tview&act=menuorder",
			data:query,
			type:"post",
			cache:false,
			dataType:"json",
			success:function(result){
				if(result.status==2){
					ajax_login();
				}
				else if(result.status==1){
					load_ctmenu_nums_list();
					get_ctmenu_float_all(true);
					$.weeboxs.close();
					$.showSuccess("下单成功！您可以去<a href='"+APP_ROOT+"/index.php?ctl=uc_order&act=takeaway' class='bc'>会员中心</a>进行查看。");
				}
				else{
					alert(result.message);
				}
				return false;
			}
		});
	}
	{/if}
</script>
{/if}